<template>
	<view :class="[primarySize()]">
		<view class="container">
			<view class="ptb20 plr30">
				<view class="item" v-for="(item,index) in enrollList">
					<view class="flex-box lh46">
						<view class="flex-grow-1 col3 fs32">{{item.intention.username}}<text class="col9 fs26 pl5"></text></view>
						<view class="col9 fs24">{{formatDatetime(item.createtime,'yyyy-mm-dd')}}</view>
					</view>
					<view class="mt10 lh40 col3 fs24">期望薪资:<text class="col8 pl10 fwb fs28">{{item.intention.fav_salary}}</text></view>
					<view class="mt30 sq flex-box">
						<image src="https://admin.mosizp.cn/static/public/icon45.png" mode="widthFix" class="ico30"></image>
						<view class="flex-grow-1 pl10 fs24 col3">意向: {{item.intention.category.name}}</view>
						<image src="https://admin.mosizp.cn/static/public/icon_address2.png" mode="widthFix" class="ico24"></image>
						<view class="pl10 fs24 col3">意向区域:{{item.intention.district.name}}</view>
					</view>
					<view class="mt30 sq flex-box">
						<image src="https://admin.mosizp.cn/static/public/icon_phone1.png" mode="widthFix" class="ico36"></image>
						<view class="flex-grow-1 pl10 fs24 col3">{{item.mobile}}</view>
						<image @click="onCall(item.mobile)" :src="iconPath('btn_phone.png')" mode="widthFix" class="ico48"></image>
						
					</view>
				</view>
				
				<view class="nothing" v-if="enrollMore.nothing">
					<image src="https://admin.mosizp.cn/static/public/icon_nothing.png" mode="aspectFit"></image>
					<text>暂无报名信息</text>
				</view>
				<view class="g-btn3-wrap" v-else>
					<view class="g-btn3" @click="fetch()">{{enrollMore.text}}</view>
				</view>
				
			</view>
		</view>
	</view>
</template>

<script>
	const app = getApp();
	export default {
		data() {
			return {
				
				taskId: 0,
				enrollList: [],
				enrollMore:{page: 1}
			}
		},
		onReady() {
			uni.setNavigationBarColor({
				frontColor: '#ffffff',
				backgroundColor: this.primaryColor()
			})
		},
		onLoad(options){
			
			this.taskId = options.id
			this.fetch();
		},
		onReachBottom() {
			this.fetch();
		},
		methods: {
			fetch() {
			    this.$util.fetch(this, "xilujob/task/enroll_list", {pagesze: 10,task_id: this.taskId}, 'enrollMore', 'enrollList', 'data');
			},
			
			onCall(mobile){
				uni.makePhoneCall({
					phoneNumber: mobile
				})
			}
		}
	}
</script>

<style lang="scss" scoped>
	.item {
		width: 690rpx;
		padding: 30rpx 30rpx 20rpx;
		background: #FFFFFF;
		border-radius: 18rpx;
		margin-bottom: 20rpx;

		.sq {
			border-top: 1px solid rgba(151, 151, 151, .1);
			padding-top: 20rpx;
		}
	}
</style>